Add a warning for a broken situation
authorMatthias Clasen <mclasen@redhat.com>
Mon, 30 May 2016 20:14:36 +0000 (16:14 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 30 May 2016 20:19:29 +0000 (16:19 -0400)
When we emit ::draw, the widget should not have alloc_needed set
anymore. If this happens, it indicates a broken situation. Add a
warning to help tracking down why this might occur.

See https://bugzilla.gnome.org/show_bug.cgi?id=765410

gtk/gtkwidget.c

index 5b0e2804510b01a350c45cf7c96c4fb18c45a196..af95148d9a000c5d123744f4aa85828a90121ced 100644 (file)
@@ -6973,6 +6973,9 @@ gtk_widget_draw_internal (GtkWidget *widget,
       if (push_group)
         cairo_push_group (cr);
 
+      if (_gtk_widget_get_alloc_needed (widget))
+        g_warning ("%s %p is drawn without a current allocation. This should not happen.", G_OBJECT_TYPE_NAME (widget), widget);
+
       if (g_signal_has_handler_pending (widget, widget_signals[DRAW], 0, FALSE))
         {
           g_signal_emit (widget, widget_signals[DRAW],